/*
 * 创建时间：2015年7月27日 
 */
package com.tuanzi.loan.workflow.vo;

import java.util.Date;

import com.tuanzi.loan.core.vo.IdentityResponse;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Ray
 * @date 2018/01/16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ProcessInstanceResponse extends IdentityResponse {

	private static final long serialVersionUID = -2579776130252555883L;

	/** 流程实例id */
	private String id;

	/** 业务编号 */
	private String businessKey;

	/** 流程定义id */
	private String processDefinitionId;

	/** 流程定义名称 */
	private String processDefinitionName;

	/** 流程启动时间 */
	private Date startTime;

	/** 流程结束时间 */
	private Date endTime;

	/** 流程持续时间 */
	private Long durationInMillis;

	/** 流程创建人帐号 */
	private String startUserId;

	/** 流程创建人名称 */
	private String startUserName;

	/** 流程启动节点 */
	private String startActivityId;

	/** 流程实例删除原因 */
	private String deleteReason;

	/** 流程实例标题 */
	private String name;

	/** 业务种类id */
	private String category;

	/** 业务种类名称 */
	private String categoryName;

	/** 流程状态：activate-执行中；suspend-已挂起；ending-已结束 */
	private String status;

	private String endActId;

	public static final String PROCESS_STATUS_ACTIVATE = "activate";
	public static final String PROCESS_STATUS_SUSPEND = "suspend";
	public static final String PROCESS_STATUS_ENDING = "ending";
	public static final String PROCESS_STATUS_ENDING_REDO_DISABLE = "ending-redo-disable";
	public static final String PROCESS_STATUS_DELETED = "deleted";

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getBusinessKey() {
		return businessKey;
	}

	public void setBusinessKey(String businessKey) {
		this.businessKey = businessKey;
	}

	public String getProcessDefinitionId() {
		return processDefinitionId;
	}

	public void setProcessDefinitionId(String processDefinitionId) {
		this.processDefinitionId = processDefinitionId;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Long getDurationInMillis() {
		return durationInMillis;
	}

	public void setDurationInMillis(Long durationInMillis) {
		this.durationInMillis = durationInMillis;
	}

	public String getStartUserId() {
		return startUserId;
	}

	public void setStartUserId(String startUserId) {
		this.startUserId = startUserId;
	}

	public String getStartActivityId() {
		return startActivityId;
	}

	public void setStartActivityId(String startActivityId) {
		this.startActivityId = startActivityId;
	}

	public String getDeleteReason() {
		return deleteReason;
	}

	public void setDeleteReason(String deleteReason) {
		this.deleteReason = deleteReason;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public String getProcessDefinitionName() {
		return processDefinitionName;
	}

	public void setProcessDefinitionName(String processDefinitionName) {
		this.processDefinitionName = processDefinitionName;
	}

	public String getStartUserName() {
		return startUserName;
	}

	public void setStartUserName(String startUserName) {
		this.startUserName = startUserName;
	}

	public String getStatus() {
		return status;
	}

	public String getStatusStr() {
		if (PROCESS_STATUS_ACTIVATE.equalsIgnoreCase(status)) {
			return "执行中";
		} else if (PROCESS_STATUS_ENDING.equalsIgnoreCase(status)) {
			return "已结束";
		} else if (PROCESS_STATUS_SUSPEND.equalsIgnoreCase(status)) {
			return "已挂起";
		} else {
			return "未知";
		}
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getEndActId() {
		return endActId;
	}

	public void setEndActId(String endActId) {
		this.endActId = endActId;
	}

	@Override
	public String toString() {
		return "ProcessInstanceVO{" + "id='" + id + '\'' + ", businessKey='" + businessKey + '\'' + ", processDefinitionId='" + processDefinitionId + '\''
				+ ", processDefinitionName='" + processDefinitionName + '\'' + ", startTime=" + startTime + ", endTime=" + endTime + ", durationInMillis=" + durationInMillis
				+ ", startUserId='" + startUserId + '\'' + ", startUserName='" + startUserName + '\'' + ", startActivityId='" + startActivityId + '\'' + ", deleteReason='"
				+ deleteReason + '\'' + ", name='" + name + '\'' + ", category='" + category + '\'' + ", categoryName='" + categoryName + '\'' + ", status='" + status + '\''
				+ ", endActId='" + endActId + '\'' + '}';
	}
}
